#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N=3e5+10;
ll a[N];
ll b[N];
void solve()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>> a[i]; 
	}
	ll cnt1=0;
	ll cnt2=0;
	for(int i=1;i<n;i++)
	{
		b[i]=a[i]-a[i-1];
		if(i%2==1)
		{
			cnt1+=b[i];
		}
		else cnt2+=b[i];
	}
	int num=n-1;
	if(num%2==0 ||(cnt1>=0))
	{
		cout<<"YES"<<endl;
	}
	else
	{
		cout<<"NO"<<endl;
	}
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		solve();
	}

	return 0;
}

